package com.ruibang.glass.produce.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruibang.glass.produce.entity.RuleBase;
import com.ruibang.glass.produce.mapper.RuleBaseMapper;
import com.ruibang.glass.produce.service.RuleBaseService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-11-20  19:07
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class RuleBaseServiceImpl extends ServiceImpl<RuleBaseMapper, RuleBase> implements RuleBaseService {


    @Override
    public List<RuleBase> getRuleBaseByDeviceId(String deviceId) {
        return lambdaQuery().eq(RuleBase::getDeviceId, deviceId).list();
    }

    @Override
    public void removeByDeviceId(String deviceId) {
        this.remove(lambdaQuery().eq(RuleBase::getDeviceId, deviceId).getWrapper());
    }
}
